package cn.easy.controller;

import cn.easy.service.UserService;
import cn.easy.vo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 张澎_9970
 * @date 2021.12.13 下午 7:26 星期一
 * @desc:
 */
@RestController
@RequestMapping("user")
public class UserController {

    @Value("${server.port}")
    private String port;

    @Autowired
    private UserService service;
    @GetMapping("{id}")
    public User findById(@PathVariable Integer id){
        System.out.println("port: " + port);
        User byId = service.findById(id);
        return byId;
    }
}
